{% extends "home/common/layout.html" %}

{% block content %}
<section class="content">
    <div class="page-header">
        <h3>站内信</h3>
    </div>
    <div class="row">
        <div class="col-md-12 col-lg-12">
            <div class="box">
                <div class="box-header with-border">
                     <div class="row">
                        <div class="col-xs-12 col-md-12 col-lg-12">
                             <form class="form-inline wrap_search">
                                 <div class="form-group">
                                    <select class="form-control" name="status">
                                        <option value="{{ CommonConstant.default_status_neg_99 }}">请选择类型</option>
                                        {% for _key,_title in CommonConstant.common_status_map3.items() %}
                                            <option value="{{_key}}" {% if _key == sc.status  %} selected {% endif %}>{{ _title }}</option>
                                        {% endfor %}
                                    </select>
                                 </div>
                                <div class="form-group">
                                    <input type="text" class="form-control"  name="kw" placeholder="请输入搜索关键词" value="{{sc['kw']}}">
                                </div>

                                 <div class="form-group">
                                     <button type="submit" class="btn btn-primary">搜索</button>
                                 </div>
                                 <a class="btn btn-link" href="{{ GlobalUrlService.buildHomeUrl('/profile/news') }}">重置搜索</a>
                                 <a class="btn btn-primary pull-right batch_ops">
                                    全部标记已读
                                </a>
                             </form>
                        </div>
                     </div>
                </div>
                <div class="box-body table-responsive no-padding" >
                    <table class="table table-bordered table-hover">
                                <thead>
                                <tr>
                                    <th width="6%">ID</th>
                                    <th>标题</th>
                                    <th width="40%">内容</th>
                                    <th width="6%">状态</th>
                                    <th width="14%">发布时间</th>
                                    <th width="8%">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                {% if list %}
                                {% for item in list %}
                                <tr>
                                    <td>{{ item.id }}</td>
                                    <td class="overflow_dot">{{ item.title }}</td>
                                    <td class="overflow_line">{{ item.content }}</td>
                                    <td>
                                        <span class="label {% if item.status == 1 %} label-success {% else %} label-danger {% endif %} ">
                                        {{ CommonConstant.common_status_map3[ item.status ] }}
                                        </span>
                                    </td>
                                    <td>{{ item.created_time }}</td>
                                    <td>
                                        {%  if item.status == 0 %}
                                            <a  class="btn btn-link ops" data-id="{{ item.id }}">已读</a>
                                        {% endif %}
                                    </td>
                                </tr>
                                {% endfor %}
                                {% else %}
                                <tr>
                                    <td colspan="6" class="text-center">(＞﹏＜)没有数据</td>
                                </tr>
                                {% endif %}
                                </tbody>
                            </table>
                </div>
                <div class="box-footer clearfix">
                    {% include 'common/pagenation.html' %}
                </div>
            </div>
        </div>
    </div>
</section>
{% endblock %}

{%block js %}
<script src="{{ GlobalUrlService.buildWWWStaticUrl('/js/home/user/profile/news.js') }}"></script>
{% endblock %}